import request from "@/utils/request";

/* 登录 */
export function loginVol(userLoginRequest){
    return request({
        url: '/api/user/login',
        method: 'post',
        data: userLoginRequest
    })
}

/* 取消登录 */
export function logout(){
    return request({
        url: '/api/user/logout',
        method: 'post'
    })
}

/* 用户条件查询 */
export function getSearchUser(name){
    return request({
        url: `/api/user/getUserByName?name=${name}`,
        method: 'get',
    })
}

/* 用户条件查询 */
export function getUserList(name,account,num){
    return request({
        url: `/api/user/list/condition?userName=${name}&userAccount=${account}&current=${num}`,
        method: 'get',
    })
}

/* 更新用户 */
export function updateUserInfo(userData){
    return request({
        url: '/api/user/update',
        method: 'post',
        data: userData
    })
}

/*上传头像*/
export function updateAva(data){
    return request({
        url: '/api/file/upload',
        method: 'post',
        data:data,
    })
}

/*新增用户*/
export function addUserFunction(userAddRequest){
    return request({
        url: '/api/user/add',
        method: 'post',
        data:userAddRequest,
    })
}

/*删除用户*/
export function deleteUser(deleteRequest){
    return request({
        url: '/api/user/delete',
        method: 'post',
        data:deleteRequest
    })
}

export function getLogin(){
    return request({
        url: '/api/user/get/login',
        method: 'get'
    })
}

